package com.adee.java;

/*
* 可变参数函数调用时可以传入数组，编译时将数组转为元素序列
* 编译后代码：
public class Test017_MutableParams {
    public static void main(String[] args) {
        test("hello", "world");
        test("hello", "world");
    }

    public static <T> void test(T... args) {
        for (T arg : args) {
            System.out.println(arg);
        }
    }
}
* */
public class Test017_MutableParams {
    public static void main(String[] args) {
        test("hello", "world");
        test(new String[]{"hello", "world"});
    }

    public static <T> void test(T...args) {
        for (T arg : args) {
            System.out.println(arg);
        }
    }
}
